package teatime.core.model.entity.base;

import java.lang.Comparable;
import java.io.Serializable;


/**
 * This is an object that contains data related to the event table.
 * Do not modify this class because it will be overwritten if the configuration file
 * related to this class is modified.
 *
 * @hibernate.class
 *  table="event"
 */

public abstract class BaseEvent  implements Comparable, Serializable {

	public static String REF = "Event";
	public static String PROP_EVENT_NAME = "EventName";
	public static String PROP_EVENT_STATUS = "EventStatus";
	public static String PROP_EVNET_CONTEXT = "EvnetContext";
	public static String PROP_END_DATE = "EndDate";
	public static String PROP_ACCOUNT_ID = "AccountId";
	public static String PROP_START_DATE = "StartDate";
	public static String PROP_CREATE_ACCOUNT_ID = "CreateAccountId";
	public static String PROP_ID = "Id";
	public static String PROP_EVENT_TYPE = "EventType";
	public static String PROP_CREATE_DATE = "CreateDate";


	// constructors
	public BaseEvent () {
		initialize();
	}

	/**
	 * Constructor for primary key
	 */
	public BaseEvent (java.lang.Integer id) {
		this.setId(id);
		initialize();
	}

	/**
	 * Constructor for required fields
	 */
	public BaseEvent (
		java.lang.Integer id,
		java.lang.String eventType,
		java.lang.String eventStatus,
		java.lang.Integer createAccountId,
		java.util.Date createDate,
		java.util.Date startDate,
		java.util.Date endDate,
		java.lang.String eventName) {

		this.setId(id);
		this.setEventType(eventType);
		this.setEventStatus(eventStatus);
		this.setCreateAccountId(createAccountId);
		this.setCreateDate(createDate);
		this.setStartDate(startDate);
		this.setEndDate(endDate);
		this.setEventName(eventName);
		initialize();
	}

	protected void initialize () {}



	private int hashCode = Integer.MIN_VALUE;

	// primary key
	private java.lang.Integer id;

	// fields
	private java.lang.Integer accountId;
	private java.lang.Integer createAccountId;
	private java.util.Date createDate;
	private java.util.Date endDate;
	private java.lang.String eventName;
	private java.lang.String eventStatus;
	private java.lang.String eventType;
	private java.lang.String evnetContext;
	private java.util.Date startDate;



	/**
	 * Return the unique identifier of this class
     * @hibernate.id
     *  generator-class="native"
     *  column="EVENT_ID"
     */
	public java.lang.Integer getId () {
		return id;
	}

	/**
	 * Set the unique identifier of this class
	 * @param id the new ID
	 */
	public void setId (java.lang.Integer id) {
		this.id = id;
		this.hashCode = Integer.MIN_VALUE;
	}




	/**
	 * Return the value associated with the column: ACCOUNT_ID
	 */
	public java.lang.Integer getAccountId () {
		return accountId;
	}

	/**
	 * Set the value related to the column: ACCOUNT_ID
	 * @param accountId the ACCOUNT_ID value
	 */
	public void setAccountId (java.lang.Integer accountId) {
		this.accountId = accountId;
	}



	/**
	 * Return the value associated with the column: CREATE_ACCOUNT_ID
	 */
	public java.lang.Integer getCreateAccountId () {
		return createAccountId;
	}

	/**
	 * Set the value related to the column: CREATE_ACCOUNT_ID
	 * @param createAccountId the CREATE_ACCOUNT_ID value
	 */
	public void setCreateAccountId (java.lang.Integer createAccountId) {
		this.createAccountId = createAccountId;
	}



	/**
	 * Return the value associated with the column: CREATE_DATE
	 */
	public java.util.Date getCreateDate () {
		return createDate;
	}

	/**
	 * Set the value related to the column: CREATE_DATE
	 * @param createDate the CREATE_DATE value
	 */
	public void setCreateDate (java.util.Date createDate) {
		this.createDate = createDate;
	}



	/**
	 * Return the value associated with the column: END_DATE
	 */
	public java.util.Date getEndDate () {
		return endDate;
	}

	/**
	 * Set the value related to the column: END_DATE
	 * @param endDate the END_DATE value
	 */
	public void setEndDate (java.util.Date endDate) {
		this.endDate = endDate;
	}



	/**
	 * Return the value associated with the column: EVENT_NAME
	 */
	public java.lang.String getEventName () {
		return eventName;
	}

	/**
	 * Set the value related to the column: EVENT_NAME
	 * @param eventName the EVENT_NAME value
	 */
	public void setEventName (java.lang.String eventName) {
		this.eventName = eventName;
	}



	/**
	 * Return the value associated with the column: EVENT_STATUS
	 */
	public java.lang.String getEventStatus () {
		return eventStatus;
	}

	/**
	 * Set the value related to the column: EVENT_STATUS
	 * @param eventStatus the EVENT_STATUS value
	 */
	public void setEventStatus (java.lang.String eventStatus) {
		this.eventStatus = eventStatus;
	}



	/**
	 * Return the value associated with the column: EVENT_TYPE
	 */
	public java.lang.String getEventType () {
		return eventType;
	}

	/**
	 * Set the value related to the column: EVENT_TYPE
	 * @param eventType the EVENT_TYPE value
	 */
	public void setEventType (java.lang.String eventType) {
		this.eventType = eventType;
	}



	/**
	 * Return the value associated with the column: EVNET_CONTEXT
	 */
	public java.lang.String getEvnetContext () {
		return evnetContext;
	}

	/**
	 * Set the value related to the column: EVNET_CONTEXT
	 * @param evnetContext the EVNET_CONTEXT value
	 */
	public void setEvnetContext (java.lang.String evnetContext) {
		this.evnetContext = evnetContext;
	}



	/**
	 * Return the value associated with the column: START_DATE
	 */
	public java.util.Date getStartDate () {
		return startDate;
	}

	/**
	 * Set the value related to the column: START_DATE
	 * @param startDate the START_DATE value
	 */
	public void setStartDate (java.util.Date startDate) {
		this.startDate = startDate;
	}





	public boolean equals (Object obj) {
		if (null == obj) return false;
		if (!(obj instanceof teatime.core.model.entity.Event)) return false;
		else {
			teatime.core.model.entity.Event event = (teatime.core.model.entity.Event) obj;
			if (null == this.getId() || null == event.getId()) return false;
			else return (this.getId().equals(event.getId()));
		}
	}

	public int hashCode () {
		if (Integer.MIN_VALUE == this.hashCode) {
			if (null == this.getId()) return super.hashCode();
			else {
				String hashStr = this.getClass().getName() + ":" + this.getId().hashCode();
				this.hashCode = hashStr.hashCode();
			}
		}
		return this.hashCode;
	}

	public int compareTo (Object obj) {
		if (obj.hashCode() > hashCode()) return 1;
		else if (obj.hashCode() < hashCode()) return -1;
		else return 0;
	}

	public String toString () {
		return super.toString();
	}


}